home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Arsenal Files 6
/
The Arsenal Files 6 (Arsenal Computer).ISO
/
prg_basi
/
n_b-v200.zip
/
NBT1
/
DMO
/
WRAPOS_F.DMO
< prev
Wrap
Text File
|
1996-03-11
|
3KB
|
58 lines
$if 0
┌──────────────────────────╖ PowerBASIC v3.20
┌──┤ DASoft ╟──────────────────────┬──────────────────╖
│ ├──────────────────────────╢ Copyright 1995 │ DATE: 1995-10-01 ╟─╖
│ │ FILE NAME WRAPOS_F.DMO ║ by ╘════════════════─ ║ ║
│ │ ║ Don Schullian, Jr. ║ ║
│ ╘══════════════════════════╝ ║ ║
│ A license is hereby granted to the holder to use this source code in ║ ║
│ any program, commercial or otherwise, without receiving the express ║ ║
│ permission of the copyright holder and without paying any royalties, ║ ║
│ as long as this code is not distributed in any compilable format. ║ ║
│ IE: source code files, PowerBASIC Unit files, and printed listings ║ ║
╘═╤═════════════════════════════════════════════════════════════════════╝ ║
│ .................................... ║
╘═══════════════════════════════════════════════════════════════════════╝
$endif
$INCLUDE "DAS-NB01.INC"
$INCLUDE "DAS-NB02.INC"
$INCLUDE "DAS-NBT1.INC"
COLOR 7, 0
CLS
? "┌───────────────────────────────────────────────────────────────────────
? "│ fWrapPosF%( Start%, T$$, LineLen%, CrLf??, Twid? )
? "├─────────────────────────────────────────────────────────────────────────
? "│ TINPUT_B is the function that handles the BLOCK inputs and uses this
? "│ function to find the wrap position within the string being edited.
? "│ Start% is the mid-pos to start printing at
? "│ T$$ is the string being printed/wrapped
? "│ LineLen% is the number of columns to be covered
? "│ CrLf?? is a 1 or 2 byte end-of-line character
? "│ Twid? is the number of characters to expand tabs (chr$(9)) to
? "│ TprintLine is used to do the final printing and you may wish to have
? "│ a quick look at how it works. SEE: TprintLine
? "└─────────────────────────────────────────────────────────────────────────────
MAP T$$ * 272
T$$ = "Once upon a time, in a land far, far away lived a little princess. " +_
"She was so beautiful that when people looked at her their eyes hurt. "+_
"So her father, the king, locked her away in a small room at the top " +_
"of a very tall tower."
Row? = 15
LineLen% = 60
CrLf?? = 0
TabWid? = 0
P2% = 0
TBoxFill Row?-1, 1, 10, 80, 177, 15
DO
P1% = ( P2% + 1 ) ' starting mid
P2% = fWrapPosF%( P1%, T$$, LineLen%, CrLf??, TabWid? ) ' ending mid
L$ = fMID$( T$$, P1%, P2% ) ' cut out mid$
TprintLine Row?, 1, LineLen%, L$, 1, CrLf??, TabWid?, 14 ' print it!
INCR Row?, 1 ' next row
LOOP UNTIL ( P2% = LEN( T$$ ) ) '